class MathDojo
	def initialize
		@total = 0
	end 
	def add(*arrays)
		num = arrays.flatten
		num.each {|x| @total += x} 
		return self
	end
	def subtract(*arrays)
		num = arrays.flatten
		num.each {|x| @total -= x} 
		return self
	end 
	def display
		return @total
	end
end
puts MathDojo.new.add(2).add(2,5).subtract(3,2).display
puts MathDojo.new.add(1).add([3,5,7,8],[2,4.3,1.25]).subtract([2,3],[1.1,2.3]).display
